package database;
import java.sql.*;



/**
 * This class represents manager used in order to interact with the DataBase
 *
 * @see This class implements singletone design pattern
 */
public class DBManager {

		public static DBManager manager=null;
		public static Connection conn=null;
		
		/**
		 * Constructor
		 */
		private DBManager(){
			try {
				Class.forName("com.mysql.jdbc.Driver").newInstance();
			} catch (Exception e) {
				
				e.printStackTrace();
				return;
			} 
			try {
				conn = DriverManager.getConnection("jdbc:mysql://localhost/project","root","1235");
			} catch (SQLException e) {
				
				e.printStackTrace();
				return;
			}
			
		}
		 
		/**
		 * Get instance of DBManager
		 * @return
		 */
		public static DBManager getInstance(){
			if (manager==null)
				manager=new DBManager();
			return manager;
		}
	
}
